<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<body>
    <div th:fragment="navbar(active)">
        <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
            <a class="navbar-brand" th:href="@{/}">OliveBranch</a>
            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false"
                aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav mr-auto">
                    <li class="nav-item" th:class="${active=='home'}?'active'">
                        <a class="nav-link" th:href="@{/}">主页</a>
                    </li>
                    <li class="nav-item" th:class="${active=='userCenter'}?'active'">
                        <a class="nav-link" th:href="@{/user/}">用户中心</a>
                    </li>
                </ul>
                <form class="form-inline" th:action="@{/project/search}" method="get">
                    <input class="form-control mr-sm-2" type="search" name="title" placeholder="搜索" aria-label="Search">
                    <button class="btn btn-outline-light my-2 my-sm-0" type="submit">搜索</button>
                </form>
            </div>
    </div>
</body>